//表单配置项
const formItemData = {
  'time': {
    itemConfig: {
      name: 'time'
    },
    elConfig: {
      formType: 'rangTime',
      placeholder: ['发货开始时间', '发货结束时间'],
      prefix: '发货时间',
    }
  },
  'orderSn': {
    itemConfig: {
      name: 'orderSn'
    },
    elConfig: {
      formType: 'Input',
      placeholder: '系统订单号',
    }
  },
  'orderType': {
    itemConfig: {
      name: 'orderType'
    },
    elConfig: {
      allowClear: false,
      formType: 'Select',
      placeholder: '订单类型',
      options: [
        { label: '正常包装', value: '1' },
        { label: '快递自发打印', value: '0' },
      ]
    }
  },
  'logisticsNo': {
    itemConfig: {
      name: 'logisticsNo'
    },
    elConfig: {
      formType: 'Input',
      placeholder: '物流单号',
    }
  },
  'logisticsId': {
    itemConfig: {
      name: 'logisticsId'
    },
    elConfig: {
      formType: 'Select',
      placeholder: '快递公司',
      options: []
    }
  },
  'ecStoreId': {
    itemConfig: {
      name: 'ecStoreId'
    },
    elConfig: {
      formType: 'Select',
      placeholder: '店铺',
      options: []
    }
  },
  'isDisexpress': {
    itemConfig: {
      name: 'isDisexpress'
    },
    elConfig: {
      formType: 'Select',
      placeholder: '是否为优惠快递',
      options: [
        { label: '是', value: '1' },
        { label: '否', value: '0' },
      ]
    }
  },
  'isMeterBilling': {
    itemConfig: {
      name: 'isMeterBilling'
    },
    elConfig: {
      formType: 'Select',
      placeholder: '是否计抛',
      options: [
        { label: '是', value: '1' },
        { label: '否', value: '0' },
      ]
    }
  },
  'useExpressCoupon': {
    itemConfig: {
      name: 'useExpressCoupon'
    },
    elConfig: {
      formType: 'Select',
      placeholder: '运费优惠券',
      options: [
        { label: '已使用', value: 1 },
        { label: '未使用', value: 0 },
      ]
    }
  },
}

//处理表单数据
export const getFormItem = (optionsData) => {
  const arr = [];
  Object.keys(formItemData).map(v => {
    if (optionsData && optionsData[v]) {
      formItemData[v].elConfig.options = optionsData[v];
    }
    arr.push(formItemData[v]);
  })
  return arr;
}